<ion-view>
  <ion-nav-title>{{titleName}}</ion-nav-title>
  <ion-nav-buttons side="left">
    <button class="button button-clear button-positive" ng-click="goBack()">取消</button>
  </ion-nav-buttons>
  <ion-nav-buttons side="right">
    <button class="button button-clear button-positive" ng-click="addOrUpdateCard()" ng-disabled="isFormDisabled()">保存
    </button>
  </ion-nav-buttons>
  <ion-content>
    <div class="center">
      <div class="button button-stable margin-left margin-right no-border margin-top padding-top"
           ng-click="testCase(testinput)">
        <span class="icon icon-large ion-android-expand gray"></span>

        <div>扫描名片</div>
      </div>
    </div>
    <form name="cardForm" ng-init="setFormScope(this)">
      <div class="list list-inset">
        <div class="item-divider padding-left4">基本信息</div>
        <label class="item item-input padding-left4">
          <input type="text" placeholder="姓名" ng-model="currentCard.cname" ng-pattern="/^[A-Za-z\u4e00-\u9fa5]+$/"
                 required>
        </label>
        <label class="item item-input padding-left4">
          <input type="text" placeholder="公司" ng-model="currentCard.company"
                 ng-pattern="/^[A-Za-z0-9_()（）\-\u4e00-\u9fa5]+$/" required>
        </label>
        <label class="item item-input padding-left4">
          <input type="text" placeholder="职务" ng-model="currentCard.duty"
                 ng-pattern="/^[A-Za-z0-9_()（）\-\u4e00-\u9fa5]+$/" required>
        </label>
      </div>

      <div class="list list-inset">
        <div class="item-divider padding-left4">联系信息</div>
        <label class="item item-input padding-left4">
          <input type="tel" placeholder="电话" ng-model="currentCard.tel" ng-pattern="/^[0-9\-()（）]{7,18}$/">
        </label>
        <label class="item item-input padding-left4" ng-maxlength="13" ng-minlength="13">
          <input type="tel" placeholder="手机" ng-model="currentCard.phone" ng-pattern="/^0?(13|15|18|14|17)[0-9]{9}$/"
                 required>
        </label>
        <label class="item item-input padding-left4">
          <input type="email" placeholder="电子邮件" ng-model="currentCard.email">
        </label>
        <label class="item item-input padding-left4">
          <input type="text" placeholder="地址" ng-model="currentCard.address"
                 ng-pattern="/^[A-Za-z0-9_()（）\#\-\u4e00-\u9fa5]+$/" required>
        </label>
      </div>
    </form>

    <ul class="list list-inset" ng-if="!currentCustomer.cid">
      <li class="item-divider padding-left4">
        <span>共享</span>
      </li>
      <li class="item item-toggle no-lrborder item-padding-left4">
        所有同事
        <label class="toggle toggle-balanced">
          <input type="checkbox" ng-model="currentCustomer.isGlobal" ng-true-value="'1'" ng-false-value="'0'">

          <div class="track">
            <div class="handle"></div>
          </div>
        </label>
      </li>
      <li>
        <a class="item no-lrborder item-padding-left4 item-icon-right" ng-click="goShareDep()">
          <label>指定部门</label>
          <label class="float-right">{{departmentLabel}}</label>
          <i class="icon icon-right ion-ios-arrow-right"></i>
        </a>
      </li>
      <li>
        <a class="item no-lrborder item-padding-left4 item-icon-right" ng-click="goSharePer()">
          <label>指定同事</label>
          <label class="float-right">{{shareUserLabel}}</label>
          <i class="icon icon-right ion-ios-arrow-right"></i>
        </a>
      </li>
    </ul>

  </ion-content>
</ion-view>
